<template>
    <el-menu
      :router="true"
      :unique-opened="true"
      :default-active="$route.path"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-submenu :index="item.id + ''" v-for="item in menuList" :key="item.id">
        <template slot="title">
          <span>{{item.authName}}</span>
        </template>
        <el-menu-item-group>
          <el-menu-item :index=" '/' + subItem.path" v-for="subItem in item.children" :key="subItem.id">
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span>{{subItem.authName}}</span>
            </template>
          </el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
</template>

<script>
export default {
  name: "NavMenu",
  props:{
    menuList:{
      type:Array,
      default(){
        return []
      }
    }
  }
};
</script>

<style scoped>
.el-menu{
  border-right: 0;
}
</style>